<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button onclick="testModule()">测试</button>
    <script>
        function testModule() {
            import('./index.js')
                .then(res=>{
                    console.log(res);
                    
                })
            obj.test=1
        }

        let number=1
        let obj={}
        Object.defineProperty(obj,'test',{
            get(){
                return number
            },
            set(newValue){
                console.log(`新的值：${newValue}`);
                number=newValue
            }
        })

        console.log(obj);
        
    </script>
</body>

</html>